package com.company.OfferGuide;

public class 替换空格 {

    public String replaceSpace(String s) {
        if (s == null || s.length() == 0) return "";
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == ' ') {
                stringBuilder.append("%20");
            } else {
                stringBuilder.append(s.charAt(i));
            }
        }

        return stringBuilder.toString();

    }

}
